import { Scene } from "three"
import { LoadActors, LoadModel } from "./SceneLoader"
import { Simulate } from "./Simulate"
import { WorkState } from "./Types"
import { ConfigureTool } from "./ConfigureTool"

console.log("Hello")
let result = await LoadActors("https://smartv-pub.oss-cn-hangzhou.aliyuncs.com/smartv-apps/prod/hecreditor/1906/scene/scene_2.actor")
LoadModel(result.__root as Scene).then(() => {
  console.log('succeed');
  let work = new Simulate(result);
  work.initData();
  while(work.workState !== WorkState.DONE) {
    work.onUpdate();
  }
  let data = work.exportPipeConnect();
  
  let test = new ConfigureTool(data)
  test.onInit();
  const jsonString = test.toJson();
  console.log(jsonString);
})

